<?php
if($_SESSION['login'] != true) {
	die('Access danied');
}
//------------------------------
define(ACTION_ADD_STATEMENTS,		'actionAddStatements');
define(ACTION_SEARCH_STATEMENT, 	'actionSearchStatement');
define(ACTION_STATISTICS,			'actionStatistics');
//------------------------------
define(MODE_MAIN_PAGE,		'modeMainPage');
//------------------------------
if(IsSet($_GET['action'])) {
	$action = $_GET['action'];
}
//------------------------------

insertMenu(0, $action);

if($action == ACTION_SEARCH_STATEMENT) {
	include('bodyShowResultsSearchStatement.php');
} else if($action == ACTION_ADD_STATEMENTS) {
	include('bodyShowResultsAddStatements.php');
} else if($action == ACTION_STATISTICS) {
	include('bodyShowResultsStatistics.php');
} else {
	?>
	<div style="text-align: left; margin: 20px 200px; padding: 10px; border: 1px solid gray;">
		Narzędzie pozwala na:
		<ul>
			<li>dodawanie nowych haseł do pobrania</li>
			<li>przeglądanie zebranych wyników</li>
			<li>przeglądanie danych statystycznych</li>
		</ul>
	</div>
	<br />
	<?php
}

?>
<br />
<?php

insertMenu(1, $action);
//enableConfirm();

/*
*	FUNKCJE
*/

function insertMenu($idN, $action) {
	?>
	<script type="text/javascript">
		$(document).ready(
			function(){
				$("#addNewPortalLink<?php echo $idN ?>").click(
					function(){
						$("#addNewPortal<?php echo $idN ?>").toggle("normal");
					}
				);
			}
		);
	</script>
	<script type="text/javascript">
		$(document).ready(
			function(){
				$("#appStateLink<?php echo $idN ?>").click(
					function(){
						$("#appState<?php echo $idN ?>").toggle("normal");
					}
				);
			}
		);
	</script>
	<a href="../"><img src="images/previous.png " alt="Wstecz">&nbsp;Strona główna</a>
	<?php
	if( $action) {
		?>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<a href="javascript: history.go(-1)"><img src="images/previous.png " alt="Powrót" title="Powrót">Powrót</a>
		<?php
	}
	?>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="<?php echo $PHP_SELF . 'indexConfiguration.php?configType=' . SHOW_RESULTS . '&action=' . ACTION_ADD_STATEMENTS ?>"><img src="images/add.gif" alt="Wstecz">&nbsp;Dodaj hasła</a>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="<?php echo $PHP_SELF . 'indexConfiguration.php?configType=' . SHOW_RESULTS . '&action=' . ACTION_SEARCH_STATEMENT ?>"><img src="images/pattern3.gif" alt="Wstecz">&nbsp;Wyszukaj hasło</a>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="<?php echo $PHP_SELF . 'indexConfiguration.php?configType=' . SHOW_RESULTS . '&action=' . ACTION_STATISTICS ?>"><img src="images/statistics2.png" alt="Wstecz">&nbsp;Statystyki</a>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<br>
	<br>
	<?php
}

?>
